<?php
global $var_yttheme;
$_productCollection = $this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
$imgWidth = $this->product_image_width;
$imgHeight = $this->product_image_height;
if ($imgWidth <= 0 || $imgHeight <= 0){
	$this->product_image_disp = false;
}
?>

<div class="block-best-seller-products top-products-menu">
	<div class="block-content">
		<?php if(!$_productCollection->count()): ?>
		<p class="note-msg">
			<?php echo $this->__('There are no products matching the selection.') ?>
		</p>
		<?php else: 
		$row = 0;
		$col= 0;
		$count = 1;
		$i=0;
		$j=0;
		$_collectionSize = $_productCollection->count();
		foreach($_productCollection as $_product): $j++;
		$this->_reviewsHelperBlock = $this->getLayout()->createBlock('review/helper');
		?>
		<?php if ($i++==0): ?>
		<div class="list-items">
			<?php endif ?>
			<div class="item <?php if ( $i == 1 ){echo "first";} ?> <?php if($i%2==0) echo $this->__('odd')?> ">
				<div class="item-inner">
					<?php if ($this->product_image_disp): ?>
					<div class="product-image">
						<a href="<?php echo $_product->getProductUrl() ?>"
							title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"
							class="product-imgs"><img
							src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($this->product_image_width,$this->product_image_height); ?>"
							alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
						</a>
					</div>
					<?php endif; ?>
					<div class="item-box-content">
						<?php if ($this->product_title_disp){ ?>
						<h2 class="product-name">
							<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
							<?php
							if ( $this->product_title_max_length > 0){
									$_productNameTruncated = Mage::helper('core/string')->truncate($_productNameStripped, $this->product_title_max_length);
								}
								?>
							<a href="<?php echo $_product->getProductUrl() ?>"
								title="<?php echo $this->stripTags($_product->getName(), null, true) ?>">
								<?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?>
							</a>
						</h2>
						<?php  } ?>


						
						<?php if ($this->product_price_disp): ?>
						<div class="price-wrapper">
							<div class="price-block">
								<?php echo $this->getPriceHtml($_product, false, '_bugs') ?>
							</div>
						</div>
						<?php endif; ?>
						<?php if ($this->product_rating_summary): ?>
						<div class="review-wrapper">
							<?php  echo $this->getReviewsSummaryHtml($_product, false, true); ?>
						</div>
						<?php endif; ?>
					</div>
				</div>
			</div>
			<?php if ($i==$_collectionSize): ?>
		</div>
		<?php endif ?>
		<?php endforeach; ?>
		<?php endif; ?>
	</div>
</div>
